var User_ids = 0; //用户传入id
var pageindex = 1; //当前页
var totalPage; //总页数
var load_length = 1400; //指定长度加载
var bool = 0; //判断变量
var load = 0;
var aaa = 0;//点击切换时用的变量
var bbb = 0;//点击切换时用的变量
var ccc = 0;

$(function() {
	get_user_mess_and_token();
	var url = location.search;
	url_index = url.indexOf('/');
	User_ids = url.substring(url.indexOf('?') + 1, (url_index != -1 ? url_index : url.length));
	if(User_ids=='' || User_ids==null){
		User_ids=user_id;
	}else{
		User_ids=User_ids;
	}
	//根据登入id查询登录用户的信息
	getByIdUser();
	//根据用户id查询关注数和粉丝数
	getGuanZhu_and_FenSi();
	//点击加载切换事件
	getClickToggle();
	//火箭式升空回到顶部
	getGotoTop();
	//检查视频和资讯两个是否有其中一项发布
	getIsNo();
});

/**
 * 根据登入id查询登录用户的信息
 */
function getByIdUser() {
	$.post("http://127.0.0.1:8899/api/consumer/Follow_userController/select_ById/" + User_ids, function(data) {
		str = "<span><div class='jsx-2665565346 author-avatar-wrap'>" +
			"<div class='jsx-2217341492 avatar_avatar-img__170Bh tw-text-0'>" +
			"<div style='display:inline-block;max-width:100%;overflow:hidden;position:relative;z-index:0' class='avatar tw-rounded-full'>" +
			"<div style='box-sizing:border-box;display:block;max-width:100%'>" +
			"<img style='max-width:100%;display:block;margin:0;border:none;padding:0' alt='' src='data:image/svg+xml;utf-8,&lt;svg width=&quot;100&quot; height=&quot;100&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot;/&gt;' aria-hidden='true' role='presentation' />" +
			"</div>" +
			"<noscript>" +
			"<img src='http://120.48.47.144:8899/images/" + data.user.user_head_portrait_url + "' alt='" + data
			.user.user_name +
			"头像' width='100' height='100' style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover' class='' />" +
			"</noscript>" +
			"<img src='http://120.48.47.144:8899/images/" + data.user.user_head_portrait_url + "' alt='" + data
			.user.user_name +
			"头像' width='100' height='100' style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover' class='' />" +
			"</div>" +
			"</div>" +
			"</div>" +
			"<div class='jsx-2665565346 author-basic-info'>" +
			"<h1 title='" + data.user.user_name +
			"' class='jsx-2665565346 tw-text-24 tw-font-medium tw-w-285 lg:tw-w-390 line-1'>" + data.user
			.user_name + "</h1>" +
			"<p title='" + data.user.user_personal_signature +
			"' class='jsx-2665565346 tw-mt-12 tw-text-common-gray tw-w-285 lg:tw-w-390 line-1'>" +
			"<span class='jsx-2665565346'>简介：</span>" + data.user.user_personal_signature + "</p>" +
			"</div></span>";
		$("#byIdUser span").remove();
		$("#byIdUser").append(str);
		load++;
		if (load == 1) {
			existsFenSi(data.user.user_id);
		}
	}, "JSON")
}

/**
 * 根据用户id查询关注数和粉丝数
 */
function getGuanZhu_and_FenSi() {
	$.post("http://127.0.0.1:8899/api/consumer/Follow_userController/select_Guanzhu_and_Fensi_ById/" + User_ids,
		function(data) {
			var guanzhu = data.GuanZhu;
			var fensi = data.FenSi;
			str =
				"<span><a class='jsx-2665565346 counter undefined tw-mr-24 md:tw-mr-40 xl:tw-mr-60' href='javascript:void(0)'>" +
				"<span class='jsx-2665565346 tw-text-16 md:tw-text-18'>" + guanzhu.followcount + "</span>" +
				"<span class='jsx-2665565346 tw-text-12 md:tw-text-14'>关注</span></a></span>" +
				"<span><a class='jsx-2665565346 counter undefined tw-mr-24 md:tw-mr-40 xl:tw-mr-60' href='javascript:void(0)'>" +
				"<span class='jsx-2665565346 tw-text-16 md:tw-text-18'>" + fensi.covercount + "</span>" +
				"<span class='jsx-2665565346 tw-text-12 md:tw-text-14'>粉丝</span></a></span>" +
				"<span class=' tw-w-76 xl:tw-w-96 2xl:tw-w-111 button new_primary button_root__3V6Iu button_new_primary__2mZuy' " +
				" role='button' onclick=\"getClick_Insert_or_delete_User('insert',this, " + guanzhu.user.user_id +
				")\" style='height:36px;display:" + ((guanzhu.user.user_id == user_id || bool == 1) ? 'none' :
					'flex') + ";align-items:center;justify-content:center'>关注</span>" +
				"<span class='follow tw-w-76 xl:tw-w-96 2xl:tw-w-111 button new_primary button_root__3V6Iu button_new_primary__2mZuy' " +
				" role='button' onclick=\"getClick_Insert_or_delete_User('delete',this, " + guanzhu.user.user_id +
				")\" style='height:36px;align-items:center;justify-content:center; display: " + (bool == 1 ?
					'block' : 'none') + ";'>已关注</span>";
			$("#FensiAndGuanzhu span").remove();
			$("#FensiAndGuanzhu").append(str);
			if(ccc==111){
				//重新加载后需要初始化一次
				aaa = 1;
				bbb = 0;
				pageindex = 1;
				load_length = 800;
				//检查该用户是否发布资讯
				existsFaBuInformations();
				//根据用户id查询发布的资讯
				getFaBuInformations();
			}else if(ccc==222){
				//重新加载后需要初始化一次
				aaa = 0;
				bbb = 1;
				pageindex = 1;
				load_length = 800;
				//检查该用户是否发布视频
				existsFaBuVideos();
				//根据用户id查询发布的视频
				getFaBuVideos();
			}else{
				//重新加载后需要初始化一次
				aaa = 1;
				bbb = 0;
				pageindex = 1;
				load_length = 800;
				//检查该用户是否发布资讯
				//existsFaBuInformations();
				//检查视频和资讯两个是否有其中一项发布
				getIsNo();
				//根据用户id查询发布的资讯
				getFaBuInformations();
			}
		}, "JSON");
}


/**
 * 点击关注用户和取消关注用户
 */
function getClick_Insert_or_delete_User(types, element, user_IDs) {
	if(user_id==0){
		location.href="http://127.0.0.1:8899/html/car_login.html?car_my_homepage";
		return;
	}else{
		$.ajax({
			url: "http://127.0.0.1:8899/api/consumer/Follow_userController/insert_or_delete_follow_user_id",
			type: "post",
			data: JSON.stringify({
				"follow_user": {
					"follow_user_fk_id": user_id,
					"follow_cover_user_fk_id": user_IDs
				},
				"type": types
			}),
			contentType: 'application/json;charset=utf-8',
			dataType: "json",
			success: function(data) {
				if (data.result == "true") {
					if (types == "insert") {
						$(element).hide();
						$(element).next().show();
					} else if (types == "delete") {
						$(element).hide();
						$(element).prev().show();
					}
					existsFenSi(user_IDs);
				}
			}
		});
	}
}

/**
 * 检查该粉丝是否存在
 */
function existsFenSi(Cover_user_ids) {
	$.post("http://127.0.0.1:8899/api/consumer/UserController/existsFenSi/"+user_id+"/" + Cover_user_ids, function(data) {
		if (data > 0) {
			bool = 1;
			getGuanZhu_and_FenSi();
		} else {
			bool = 0;
			getGuanZhu_and_FenSi();
		}
	}, "JSON");
}

/**
 * 点击切换事件
 */
function getClickToggle() {
	$("#Information").click(function() {
		aaa = 1;
		bbb = 0;
		ccc = 111;
		pageindex = 1;
		load_length = 800;
		$(this).addClass("jsx-2665565346 header-tab active tw-relative tw-mr-40");
		$("#Video").removeClass("jsx-2665565346 header-tab active tw-relative tw-mr-40");
		$("#Video").addClass("jsx-2665565346 header-tab  tw-relative tw-mr-40");
		//检查该用户是否发布资讯
		existsFaBuInformations();
		//根据用户id查询发布的资讯
		getFaBuInformations();
		//移除视频的div
		$("#Videos section").remove();

	});
	$("#Video").click(function() {
		aaa = 0;
		bbb = 1;
		ccc = 222;
		pageindex = 1;
		load_length = 800;
		$(this).addClass("jsx-2665565346 header-tab active tw-relative tw-mr-40");
		$("#Information").removeClass("jsx-2665565346 header-tab active tw-relative tw-mr-40");
		$("#Information").addClass("jsx-2665565346 header-tab  tw-relative tw-mr-40");
		//检查该用户是否发布视频
		existsFaBuVideos();
		//根据用户id查询发布的视频
		getFaBuVideos();
		//移除资讯的div
		$("#Informations section").remove();
	});
}

/**
 * 根据用户id查询发布的视频
 */
function getFaBuVideos() {
	$.post("http://127.0.0.1:8899/api/consumer/UserController/select_videoList_byUserId/" + User_ids + "/" + pageindex,
		function(data) {
			var str = "";
			var cishu = 0;
			$(data.VideoList).each(function(index, item) {
				if (item.video_broadcast_count / 10000 > 1) {
					cishu = (item.video_broadcast_count / 10000).toFixed(2) + "万";
				} else {
					cishu = item.video_broadcast_count;
				}
				totalPage = data.totalPage;
				str +=
					"<section class='jsx-1799666301 community-card tw-text-common-black tw-text-16 tw-px-24 tw-py-20 tw-mt-16 tw-border-1 tw-border-solid tw-border-video-gray'>" +
					"<div class='tw-flex tw-items-center'>" +
					"<div class='tw-flex-1'><a href='http://127.0.0.1:8899/html/car_my_homepage.html?" +
					item.user.user_id + "' title='" + item.user.user_name +
					"个人主页 'target='_blank'>" +
					"<div class='tw-overflow-hidden tw-flex tw-items-center tw-pr-16'>" +
					"<div class='tw-relative tw-flex-none'>" +
					"<div class='jsx-2217341492 avatar_avatar-img__170Bh tw-text-0'>" +
					"<div style='display:inline-block;max-width:100%;overflow:hidden;position:relative;z-index:0'class='avatar tw-rounded-full'>" +
					"<div style='box-sizing:border-box;display:block;max-width:100%'>" +
					"<img style='max-width:100%;display:block;margin:0;border:none;padding:0'" +
					"alt=''" +
					"src='data:image/svg+xml;utf-8,&lt;svg width=&quot;40&quot; height=&quot;40&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot;/&gt;'" +
					"aria-hidden='true'" +
					"role='presentation' />" +
					"</div>" +
					"<noscript><img " +
					"src='http://120.48.47.144:8899/images/" + item.user.user_head_portrait_url + "'" +
					"alt='" + item.user.user_name + "头像' width='40px' height='40px'" +
					"style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover' /></noscript><img" +
					" src='http://120.48.47.144:8899/images/" + item.user.user_head_portrait_url + "'" +
					"alt='" + item.user.user_name + "头像' width='40px' height='40px'" +
					"style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover'" +
					"class='zoom' />" +
					"</div><i class='jsx-2217341492 avatar_author-v__2Xocb author-v v-yellow'></i>" +
					"</div>" +
					"</div>" +
					"<div class='tw-ml-16 tw-flex tw-flex-col tw-justify-center'>" +
					"<div class='tw-overflow-hidden tw-flex tw-items-center tw-h-20'>" +
					"<p class=' line-1 g-active-link-text tw-font-medium'>" +
					"<span class='tw-text-16 tw-text-black'>" + item.user.user_name + "</span>" +
					"<span class='tw-text-14 tw-text-color-gray-900'></span>" +
					"</p>" +
					"</div>" +
					"<div class='tw-h-16 tw-mt-4 tw-flex tw-items-center'>" +
					"<span class='tw-text-12 tw-text-video-shallow-gray'>" + item.user
					.user_personal_signature + "</span>" +
					"</div>" +
					"</div>" +
					"</div>" +
					"</a></div>" +
					"<button type='button' onclick=\"getClick_Insert_or_delete_User('insert',this,"+item.user.user_id+")\" class='tw-font-medium tw-h-20 tw-leading-20 tw-text-common-orange tw-text-12 md:tw-text-14 xl:tw-text-14' style='display:" +
					((item.user.user_id == user_id || bool == 1) ? 'none' : 'block') +
					"'><i class='DCD_Icon icon_add_24 tw-text-14'></i>关注</button>" +
					"<button type='button' onclick=\"getClick_Insert_or_delete_User('delete',this,"+item.user.user_id+")\" class='tw-font-medium tw-h-20 tw-leading-20 tw-text-common-green tw-text-12 md:tw-text-14 xl:tw-text-14' style='display:" +
					(bool == 1 ? 'block' : 'none') + "'>已关注</button>" +
					"</div>" +
					"<div class='jsx-81802501 jsx-2089696349 tw-mt-12'><a "+
					"title='" + item.video_introduction + "' href='http://127.0.0.1:8899/html/car_video_broadcast.html?" + item.video_id +"'"+
					"target='_blank' class='jsx-1095092229 g-active-link-text'>" +
					"<h3 class='jsx-81802501 jsx-2089696349 tw-font-medium tw-leading-22 line-1 tw-text-14 md:tw-text-16 xl:tw-text-18'>" +
					"" + item.video_introduction + "</h3>" +
					"</a></div>" +
					"<div class='tw-mt-12 tw-w-266'>" +
					"<div class='tw-relative' style='padding-bottom:56.39%'>" +
					"<div class='tw-absolute tw-inset-0 tw-cursor-pointer'>" +
					"<div style='display:block;overflow:hidden;position:absolute;top:0;left:0;bottom:0;right:0;z-index:0'>" +
					"<a title='" + item.video_introduction + "' href='http://127.0.0.1:8899/html/car_video_broadcast.html?" + item.video_id +"' target='_blank' class='jsx-1095092229 g-active-link-text'>"+
					"<noscript><img " +
					"src='http://120.48.47.144:8899/images/" + item.video_images_url + "'" +
					"alt='" + item.video_introduction + "视频1' width='266'" +
					"height='150'" +
					"style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover' /></noscript><img" +
					" src='http://120.48.47.144:8899/images/" + item.video_images_url + "'" +
					"alt='" + item.video_introduction + "视频1' width='266'" +
					"height='150'" +
					"style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover'" +
					"class='' />" +
					"</a></div><span" +
					"class='tw-absolute tw-inset-0 tw-m-auto tw-w-40 tw-h-40 tw-text-white tw-flex tw-items-center tw-justify-center tw-bg-common-black tw-bg-opacity-50 tw-rounded-100'><i" +
					"class='DCD_Icon icon_play_1 tw-text-14 tw-text-24'></i></span>" +
					"</div>" +
					"</div>" +
					"</div>" +
					"<div class='jsx-1875074220 tw-flex tw-mt-12'>" +
					"<div class='jsx-1875074220 tw-flex tw-items-center tw-flex-1 tw-overflow-hidden tw-mr-24 tw-text-12 md:tw-text-14 xl:tw-text-14'>" +
					"</div>" +
					"<div class='jsx-1875074220 tw-flex tw-mt-12'>" +
					"<div class='jsx-1875074220 tw-flex tw-items-center tw-flex-1 tw-overflow-hidden tw-mr-24 tw-text-12 md:tw-text-14 xl:tw-text-14'>" +
					"</div>" +
					"<div class='jsx-1875074220 right tw-flex tw-items-center tw-flex-none tw-text-12 md:tw-text-14 xl:tw-text-14'>" +
					"<span>" + item.video_upload_date + "</span>" +
					"<span>" + cishu + "次播放</span>" +
					"</div>" +
					"</div>" +
					"</div>" +
					"</section>";
			})
			if (pageindex == 1) {
				$("#Videos section").remove();
				$("#Informations section").remove();
			}
			$("#Videos").append(str);
		}, "JSON");
}

/**
 * 
 *检查视频和资讯两个是否有其中一项发布
 */
function getIsNo() {
	$.post("http://127.0.0.1:8899/api/consumer/UserController/existsVideo_and_Information/" + User_ids, function(data) {
		if (data.existsVideo == 0 && data.exixtsInformation == 0) {
			$("#NoRelease").show();
			$("#videoAndinformation").hide();
			$("#informationTA").hide();
			$("#videoTA").hide();
			$("#gotoTop").hide();
			$("#noMore").hide();
		} else {
			existsFaBuInformations();
		}
	}, "JSON");
}
/**
 * 检查该用户是否发布视频
 */
function existsFaBuVideos() {
	$.post("http://127.0.0.1:8899/api/consumer/UserController/existsSelect_videoList_byUserId/" + User_ids, function(
		data) {
		if (data != null && data != '') {
			$("#NoRelease").hide();
			$("#noMore").show();
		} else {
			$("#NoRelease").show();
			$("#informationTA").hide();
			$("#NoTA").hide();
			$("#informationHref").hide();
			$("#gotoTop").hide();
			$("#noMore").hide();
		}
	}, "JSON");
}


/**
 * 检查该用户是否发布资讯
 */
function existsFaBuInformations() {
	$.post("http://127.0.0.1:8899/api/consumer/UserController/existsSelect_information_byUserId/" + User_ids, function(
		data) {
		if (data != null && data != '') {
			$("#NoRelease").hide();
			$("#noMore").show();
		} else {
			$("#NoRelease").show();
			$("#videoTA").hide();
			$("#NoTA").hide();
			$("#videoHref").hide();
			$("#gotoTop").hide();
			$("#noMore").hide();
		}
	}, "JSON");
}


/**
 * 根据用户id查询发布的资讯
 */
function getFaBuInformations() {
	$.post("http://127.0.0.1:8899/api/consumer/UserController/select_information_byUserId/" + User_ids + "/" +
		pageindex,
		function(data) {
			var str = "";
			var count = 0;
			$(data.InformationLists).each(function(index, item) {
				if (item.information_read_count / 10000 > 1) {
					count = (item.information_read_count / 10000).toFixed(2) + "万";
				} else {
					count = item.information_read_count;
				}
				totalPage = data.totalPages;
				str +=
					"<section class='jsx-1799666301 community-card tw-text-common-black tw-text-16 tw-px-24 tw-py-20 tw-mt-16 tw-border-1 tw-border-solid tw-border-video-gray'>" +
					"<div class='tw-flex tw-items-center'>" +
					"<div class='tw-flex-1'><a href='http://127.0.0.1:8899/html/car_my_homepage.html?"+item.user.user_id+"' title='" + item.user.user_name +
					"个人主页 'target='_blank'>" +
					"<div class='tw-overflow-hidden tw-flex tw-items-center tw-pr-16'>" +
					"<div class='tw-relative tw-flex-none'>" +
					"<div class='jsx-2217341492 avatar_avatar-img__170Bh tw-text-0'>" +
					"<div style='display:inline-block;max-width:100%;overflow:hidden;position:relative;z-index:0' class='avatar tw-rounded-full'>" +
					"<div style='box-sizing:border-box;display:block;max-width:100%'>" +
					"<img style='max-width:100%;display:block;margin:0;border:none;padding:0'alt=''" +
					"src='http://120.48.47.144:8899/images/" + item.user.user_head_portrait_url + "'" +
					"aria-hidden='true'" +
					"role='presentation' class='jsx-370420434 tw-object-center tw-object-cover'/>" +
					"</div>" +
					"<noscript><img src='http://120.48.47.144:8899/images/" + item.user
					.user_head_portrait_url + "'" +
					"alt='" + item.user.user_name + "头像' width='40' height='40'" +
					"style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover' class='jsx-370420434 tw-object-center tw-object-cover' /></noscript>" +
					"<img src='http://120.48.47.144:8899/images/" + item.user.user_head_portrait_url + "'" +
					"alt='" + item.user.user_name + "头像' width='40' height='40'" +
					"style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover'" +
					"class='jsx-370420434 tw-object-center tw-object-cover' />" +
					"</div><i class='jsx-2217341492 avatar_author-v__2Xocb author-v v-yellow'></i>" +
					"</div>" +
					"</div>" +
					"<div class='tw-ml-16 tw-flex tw-flex-col tw-justify-center'>" +
					"<div class='tw-overflow-hidden tw-flex tw-items-center tw-h-20'>" +
					"<p class=' line-1 g-active-link-text tw-font-medium'>" +
					"<span class='tw-text-16 tw-text-black'>" + item.user.user_name + "</span>" +
					"<span class='tw-text-14 tw-text-color-gray-900'></span>" +
					"</p>" +
					"</div>" +
					"<div class='tw-h-16 tw-mt-4 tw-flex tw-items-center'>" +
					"<span class='tw-text-12 tw-text-video-shallow-gray'>" + item.user
					.user_personal_signature + "</span>" +
					"</div>" +
					"</div>" +
					"</div>" +
					"</a></div>" +
					"<button onclick=\"getClick_Insert_or_delete_User('insert',this,"+item.user.user_id+")\" type='button'class='tw-font-medium tw-h-20 tw-leading-20 tw-text-common-orange tw-text-12 md:tw-text-14 xl:tw-text-14' style='display:" +
					((item.user.user_id == user_id || bool == 1) ? 'none' : 'block') +
					"'><i class='DCD_Icon icon_add_24 tw-text-14'></i>关注</button>" +
					"<button onclick=\"getClick_Insert_or_delete_User('delete',this,"+item.user.user_id+")\" type='button' class='tw-font-medium tw-h-20 tw-leading-20 tw-text-common-green tw-text-12 md:tw-text-14 xl:tw-text-14' style='display:" +
					(bool == 1 ? 'block' : 'none') + "'>已关注</button>" +
					"</div>" +
					"<div class='jsx-81802501 jsx-2089696349 tw-mt-12'>"+
					"<a title='" + item.information_title + "' href='http://127.0.0.1:8899/html/car_information_details.html?"+item.information_id +"/0' target='_blank' class='jsx-1095092229 g-active-link-text'>" +
					"<h3 class='jsx-81802501 jsx-2089696349 tw-font-medium tw-leading-22 line-1 tw-text-14 md:tw-text-16 xl:tw-text-18'>" +
					"" + item.information_title + "</h3>" +
					"</a></div>" +
					"<div class='jsx-3125371293 tw-mt-12'>" +
					"<div class='jsx-3125371293 tw-grid tw-grid-cols-5 2xl:tw-grid-cols-6 tw-gap-8'>" +

					"<div class='jsx-3125371293 wrapper tw-relative'>" +
					"<div style='display:block;overflow:hidden;position:relative;z-index:0'" +
					"class='tw-rounded-2 g-load-img-wrap tw-cursor-zoom-in'>" +
					"<div style='display:block;box-sizing:border-box;padding-top:100%'></div>"+
					"<a title='" + item.information_title + "' href='http://127.0.0.1:8899/html/car_information_details.html?"+item.information_id +"/0' target='_blank' class='jsx-1095092229 g-active-link-text'>" +
					"<noscript><img src='http://120.48.47.144:8899/images/" + item.information_images.information_images_1 + "'" +
					"alt='" + item.information_title + "图1' width='160'" +
					"height='160' style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover' /></noscript>" +
					"<img src='http://120.48.47.144:8899/images/" + item.information_images
					.information_images_1 + "'" +
					"alt='" + item.information_title + "图1' width='160'" +
					"height='160'" +
					"style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover'" +
					"class='zoom' /></a>" +
					"</div>" +
					"</div>" +
					"<div class='jsx-3125371293 wrapper tw-relative'>" +
					"<div style='display:block;overflow:hidden;position:relative;z-index:0'" +
					"class='tw-rounded-2 g-load-img-wrap tw-cursor-zoom-in'>" +
					"<div style='display:block;box-sizing:border-box;padding-top:100%'>" +
					"</div>"+
					"<a title='" + item.information_title + "' href='http://127.0.0.1:8899/html/car_information_details.html?"+item.information_id +"/0' target='_blank' class='jsx-1095092229 g-active-link-text'>" +
					"<noscript><img src='http://120.48.47.144:8899/images/" + item.information_images.information_images_2 + "'" +
					"alt='" + item.information_title + "图2' width='160'" +
					"height='160' style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover' /></noscript>" +
					"<img src='http://120.48.47.144:8899/images/" + item.information_images
					.information_images_2 + "'" +
					"alt='" + item.information_title + "图2' width='160'" +
					"height='160'" +
					"style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover'" +
					"class='zoom' /></a>" +
					"</div>" +
					"</div>" +
					"<div class='jsx-3125371293 wrapper tw-relative'>" +
					"<div style='display:block;overflow:hidden;position:relative;z-index:0'" +
					"class='tw-rounded-2 g-load-img-wrap tw-cursor-zoom-in'>" +
					"<div style='display:block;box-sizing:border-box;padding-top:100%'>" +
					"</div>"+
					"<a title='" + item.information_title + "' href='http://127.0.0.1:8899/html/car_information_details.html?"+item.information_id +"/0' target='_blank' class='jsx-1095092229 g-active-link-text'>" +
					"<noscript><img src='http://120.48.47.144:8899/images/" + item.information_images.information_images_3 + "'" +
					"alt='" + item.information_title + "图3' width='160'" +
					"height='160' style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover' /></noscript>" +
					"<img src='http://120.48.47.144:8899/images/" + item.information_images
					.information_images_3 + "'" +
					"alt='" + item.information_title + "图3' width='160'" +
					"height='160'" +
					"style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover'" +
					"class='zoom' /></a>" +
					"</div>" +
					"</div>" +
					"<div class='jsx-3125371293 wrapper tw-relative'>" +
					"<div style='display:block;overflow:hidden;position:relative;z-index:0'" +
					"class='tw-rounded-2 g-load-img-wrap tw-cursor-zoom-in'>" +
					"<div style='display:block;box-sizing:border-box;padding-top:100%'>" +
					"</div>"+
					"<a title='" + item.information_title + "' href='http://127.0.0.1:8899/html/car_information_details.html?"+item.information_id +"/0' target='_blank' class='jsx-1095092229 g-active-link-text'>" +
					"<noscript><img src='http://120.48.47.144:8899/images/" + item.information_images.information_images_4 + "'" +
					"alt='" + item.information_title + "图4' width='160'" +
					"height='160' style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover' /></noscript>" +
					"<img src='http://120.48.47.144:8899/images/" + item.information_images
					.information_images_4 + "'" +
					"alt='" + item.information_title + "图4' width='160'" +
					"height='160'" +
					"style='position:absolute;top:0;left:0;bottom:0;right:0;box-sizing:border-box;padding:0;border:none;margin:auto;display:block;width:0;height:0;min-width:100%;max-width:100%;min-height:100%;max-height:100%;object-fit:cover'" +
					"class='zoom' /></a>" +
					"</div>" +
					"</div>" +

					"</div>" +
					"</div>" +
					"<div class='jsx-1875074220 tw-flex tw-mt-12'>" +
					"<div class='jsx-1875074220 tw-flex tw-items-center tw-flex-1 tw-overflow-hidden tw-mr-24 tw-text-12 md:tw-text-14 xl:tw-text-14'>" +
					"</div>" +
					"<div class='jsx-1875074220 tw-flex tw-mt-12'>" +
					"<div class='jsx-1875074220 tw-flex tw-items-center tw-flex-1 tw-overflow-hidden tw-mr-24 tw-text-12 md:tw-text-14 xl:tw-text-14'>" +
					"</div>" +
					"<div class='jsx-1875074220 right tw-flex tw-items-center tw-flex-none tw-text-12 md:tw-text-14 xl:tw-text-14'>" +
					"<span>" + item.information_release_date + "</span>" +
					"<span>" + count + "次播放</span>" +
					"</div>" +
					"</div>" +
					"</div>" +
					"</section>";
			})
			if (pageindex == 1) {
				$("#Informations section").remove();
				$("#Videos section").remove();
			}
			$("#Informations").append(str);
		}, "JSON");
}


/**
 * 火箭式升空
 */
function getGotoTop(windowTop) {
	$("#gotoTop").click(function() {
		$('html,body').animate({
			scrollTop: '0px'
		}, 'slow');
	});

	windowTop ? windowTop = windowTop : windowTop = 100;

	$(window).scroll(function() {
		var height = $(window).scrollTop();
		if (height > windowTop) {
			$("#gotoTop").fadeIn(500);
		} else {
			$("#gotoTop").fadeOut(500);
		}
	});
}

/**
 * 
 * 懒加载
 */
window.onscroll = function() {
	var scroll_Top = document.body.scrollTop || document.documentElement.scrollTop;
	var window_Top = window.innerHeight;
	if (scroll_Top + window_Top > load_length && pageindex != totalPage) {
		pageindex++;
		if (aaa == 1) {
			//根据用户id查询发布的资讯(点击资讯时加载)
			getFaBuInformations();
		} else if (bbb == 1) {
			//根据用户id查询发布的视频(点击视频时加载)
			getFaBuVideos();
		} else {
			//根据用户id查询发布的资讯（先加载一遍）
			getFaBuInformations();
		}
		load_length += 800;
	}
}
